feat(backend): support organization-scoped sign-in tokens#9192
Conversation
🦋 Changeset detectedLatest commit: 9389ae4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough
ChangesSign-in token organization activation
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
ApprovabilityVerdict: Approved Adds an optional You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/backend/src/api/__tests__/SignInTokenApi.test.ts (1)
13-45: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winCover the optional-field and error-path cases.
This test only covers the happy path with
orgIdpresent. Add cases verifying that omittedorgIdis not serialized and that backend errors are propagated correctly. As per coding guidelines, new functionality must include edge-case and error-handling coverage.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/backend/src/api/__tests__/SignInTokenApi.test.ts` around lines 13 - 45, Extend the sign-in token tests around apiClient.signInTokens.createSignInToken to verify that omitting orgId excludes org_id from the request payload, and add an error-path case where the mocked backend failure is propagated to the caller. Preserve the existing organization-ID happy-path assertion.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/backend/src/api/__tests__/SignInTokenApi.test.ts`:
- Around line 13-45: Extend the sign-in token tests around
apiClient.signInTokens.createSignInToken to verify that omitting orgId excludes
org_id from the request payload, and add an error-path case where the mocked
backend failure is propagated to the caller. Preserve the existing
organization-ID happy-path assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Repository UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: aef2e311-82f7-484a-9e93-4f3d2c30dfe0
📒 Files selected for processing (3)
.changeset/tidy-tokens-activate.mdpackages/backend/src/api/__tests__/SignInTokenApi.test.tspackages/backend/src/api/endpoints/SignInTokenApi.ts
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Summary
orgIdfield toCreateSignInTokensParamsorg_idin the Backend API request@clerk/backendContext
Supports the organization-scoped sign-in token API introduced in clerk/clerk_go#20464.
Related SDK and docs work:
Manual verification
The organization-scoped sign-in token flow was exercised against the local backend branch.
Validation
pnpm turbo build --filter=@clerk/backendpnpm turbo test --filter=@clerk/backendpnpm --filter @clerk/backend lintpnpm --filter @clerk/backend format:checkSummary by CodeRabbit